import { lazy } from 'react'
import { RouterItem } from '../utils/type'

// 二级
export const layoutRouter: RouterItem[] = [
  {
    path: '/layout/home',
    title: '首页',
    element: lazy(() => import('../view/home/Index'))
  },
  {
    path: '/layout/exhibition',
    title: '展厅',
    element: lazy(() => import('../view/exhibition/Index'))
  }
]

// 一级
export const router: RouterItem[] = [
  {
    path: '/',
    to: '/layout/home'
  },
  {
    path: '/layout',
    element: lazy(() => import('../view/layout/Index')),
    children: layoutRouter
  },
  {
    path: '/aa',
    element: lazy(() => import('../view/aa/Index'))
  },
  {
    path: '/login',
    element: lazy(() => import('../view/login/Index'))
  },
  {
    path: '*',
    element: lazy(() => import('../view/error/Index'))
  }
]
